<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <script language="JavaScript">

        if (window !== top)

            top.location.href = location.href;

    </script>
    <meta charset="utf-8">
    <title>首页</title>
    <link th:href="@{/css/base.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/css/toefl.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css">
    <script type="text/javascript" th:src="@{js/jquery-2.1.0.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
</head>

<body>

<div class="doc1180">
    <div class="header">
        <div class="logo"><a th:href="@{/}"><img th:src="@{/img/logo.png}"></a></div>
        <div class="headerUser">
            <ul>
                <li class="headerUserPic"><a th:href="@{/user/info}" target="ifr"><img th:src="@{/user/getAvatar}"></a>
                </li>
                <li class="headerUserName"><a th:href="@{/user/info}" th:text="${session.USER_SESSION_KEY.userName}"
                                              target="ifr"></a></li>
                <li class="headerUserNotice">通知<a href="###">14</a></li>
            </ul>
        </div>
        <div class="headerLink">
            <a th:href="@{/security/toLogin}" target="ifr" class="###">登录</a>
            <a th:href="@{/user/toInput}" target="ifr" class="###">注册</a>
            <a th:href="@{/security/logout}" class="###">登出</a>
        </div>
    </div>
</div>
<div class="menu">
    <div class="doc1180">
        <div class="menuLink">
            <ul class="fn-clear">
                <li class="active"><a th:href="@{/main.html}" target="ifr">首页</a></li>
                <li><a th:href="@{/article/home}" target="ifr">托福人</a></li>
                <li><a th:href="@{/公开课/main.html}" target="ifr">公开课</a></li>
                <li><a th:href="@{/群组聊/组群聊-组群聊.html}" target="ifr">群组聊</a></li>
                <li><a th:href="@{/福利城堡/福利城堡-福利城堡.html}" target="ifr">福利城堡</a></li>
            </ul>
        </div>
        <div class="fenxiang">
            <a href="#" class="weibo"><img th:src="@{/img/weibo.png}"></a>
            <a href="#" class="weixin"><img th:src="@{/img/weixin.png}"></a>
        </div>
    </div>
</div>

<iframe id="ifr" name='ifr' th:src="@{/main.html}" style="width: 98vw;height: 84vh;" frameborder="no"></iframe>
<iframe th:src="@{/footer.html}" style="width: 99vw;height: 32vh;" frameborder="no"></iframe>


<script type="text/javascript">
    // 计算页面的实际高度，iframe自适应会用到
    function calcPageHeight(doc) {
        var cHeight = Math.max(doc.body.clientHeight, doc.documentElement.clientHeight);
        var sHeight = Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight);
        var height = Math.max(doc.body.clientHeight, doc.body.scrollHeight);
        return height
    }

    var ifr = document.getElementById('ifr')
    ifr.onload = function () {
        var inter = window.setInterval(function () {
            var iDoc = ifr.contentDocument || ifr.document
            var height = calcPageHeight(iDoc)
            ifr.style.height = height + 'px'

        }, 100);
        window.setTimeout(function () {
            window.clearInterval(inter);
        }, 10000);

    }
</script>


<!-- 代码结束 -->
</body>
</html>
